
<?php
/**
 * RedCross Application
 *
 * @copyright Copyright (c) 2010, Kristian Stokke Tryggestad, Rune Vikestad, Andreas Flaten Wist, Simen Nicolai Echholt, Ole Henrik Jahren
 */

/**
 * Service for the events
 *
 * @category    RedCross
 * @package     Core_Service
 */
class Core_Service_Calendar extends RedCross_Service_ServiceAbstract
{

	public function __construct(Core_Gateway_Calendar $gateway)
	{
		parent::__construct($gateway, 'Core_Model_Calendar');
	}

	public function create(Core_Model_Calendar $calendar)
	{
		$this->checkAcl('create');

		return $this->save($calendar);
	}

	public function fetchAll($paginate = false)
	{
        $this->checkAcl('fetch');
		return $this->getGateway()->fetchAllCalendar($paginate);
	}
}
